package com.example.shouybl.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.shouybl.R;
import com.example.shouybl.bean.MoneyGameLike;
import com.example.shouybl.utils.ImageLoaderUtil;
import com.nostra13.universalimageloader.core.ImageLoader;

import java.util.List;

/**
 * Created by liuZhi
 * 2015/10/16
 * 2015 current year.
 */
public class LikeAdapter extends AppBaseAdapter<MoneyGameLike> {
    public LikeAdapter(List<MoneyGameLike> list, Context context) {
        super(list, context);
    }

    @Override
    public ViewHolder getViewHolder(int position, View convertView, ViewGroup parent) {
        MoneyGameLike like=list.get(position);
        ViewHolder vh=ViewHolder.get(context,convertView,parent, R.layout.item_game_gview_layout);
        ImageView ivIcon= (ImageView) vh.findViewById(R.id.game_hot_img);
        TextView tvName= (TextView) vh.findViewById(R.id.game_hot_name);

        ImageLoader.getInstance().displayImage(like.getIcon(),ivIcon, ImageLoaderUtil.getDefaultOptions());
        tvName.setText(like.getName());
        return vh;
    }
}
